﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nauka.GUI;

namespace Nauka.engine
{
    public class StatsFilter
    {
        //private System.Windows.Forms.CheckedListBox LimitsCheckedListBox;

        public StatsFilter()
        {
            hands = true;
            VPIP = true;
            VPIP_SB = false;
            PFR = true;
            AF = true;
            AF_Flop = false;
            AF_Turn = false;
            AF_River = false;
            WTS = true;
            WTSwsF = true;
            Amounthh = true;
            BBhh = true;
        // Amount100 = 
            BB100 = true;
            AmountWon = true;
            BBwon = true;
        // WonwsF = 
            WaS  = true;
            SawFlopNotBlinds = false;
            SawFlop = false;

            StealAttempt = true;
            FoldRiver = false;
            FoldTurn = false;
            FoldFlop = false;
            FoldPreflop = false;
            minutesPlayed = false;
        }

        public string generateSQLquery(){
            string sql_query = "SELECT ";
            if (hands == true)
            {
                sql_query += "played_hands as Hands, ";
            }
            if (VPIP == true)
            {
                sql_query += "vpip as 'VP$IP', ";
            }
            if (VPIP_SB == true)
            {
                sql_query += "vpip_sb as 'VP$IP SB', ";
            }
            if (PFR == true)
            {
                sql_query += "pfr as PFR, ";
            }
            if (AF == true)
            {
                sql_query += "af as AF, ";
            }
            if (AF_Flop == true)
            {
                sql_query += "af_flop as 'AF Flop', ";
            }
            if (AF_Turn == true)
            {
                sql_query += "af_turn as 'AF Turn', ";
            }
            if (AF_River == true)
            {
                sql_query += "af_river as 'AF River', ";
            }
            if (WTS == true)
            {
                sql_query += "went_to_showdown as 'Went To Showdown', ";
            }
            if (WTSwsF == true)
            {
                sql_query += "went_to_showdown_wsf as 'WTSwsF', ";
            }
            if (Amounthh == true)
            {
                sql_query += "winrate_hh as '$/h', ";
            }
            if (BBhh == true)
            {
                sql_query += "bb_per_hh as 'BB/h', ";
            }
            if (BB100 == true)
            {
                sql_query += "bb_per_100 as 'BB/100', ";
            }
            if (AmountWon == true)
            {
                sql_query += "amount_won as '$ won', ";
            }
            if (BBwon == true)
            {
                sql_query += "bb_won as 'BB won', ";
            }
            if ( WaS == true)
            {
                sql_query += "won_at_showdown as 'Won at Showdown', ";
            }
            if ( SawFlop == true)
            {
                sql_query += "saw_flop_all_hands as 'Saw Flop', ";
            }
            if ( SawFlopNotBlinds == true)
            {
                sql_query += "saw_flop_not_blind as 'Saw Flop not Blinds', ";
            }
            if (StealAttempt == true)
            {
                sql_query += "steal_attempt as 'Steal Attempt', ";
            }
            if (FoldPreflop == true)
            {
                sql_query += "fold_hand_preflop as 'Fold Preflop', ";
            }
            if (FoldFlop == true)
            {
                sql_query += "fold_hand_flop as 'Fold Flop', ";
            }
            if (FoldTurn == true)
            {
                sql_query += "fold_hand_turn as 'Fold Turn', ";
            }
            if (FoldRiver == true)
            {
                sql_query += "fold_hand_river as 'Fold River', ";
            }
            if (minutesPlayed == true)
            {
                sql_query += "minutes_played as 'Minutes Played', ";
            }

            sql_query = sql_query.Substring(0, sql_query.Length - 2);
            sql_query += " FROM Player WHERE player_name = @player_name";

            return sql_query;
        }

        public string hero { get; set; }

        public bool hands { get; set; }
        public bool VPIP{ get; set; }
        public bool VPIP_SB{ get; set; }
        public bool PFR{ get; set; }
        public bool AF{ get; set; }
        public bool AF_Flop{ get; set; }
        public bool AF_Turn{ get; set; }
        public bool AF_River{ get; set; }
        public bool WTS{ get; set; }
        public bool WTSwsF{ get; set; }
        public bool Amounthh{ get; set; }
        public bool BBhh{ get; set; }
        //public bool Amount100{ get; set; }
        public bool BB100{ get; set; }
        public bool AmountWon{ get; set; }
        public bool BBwon{ get; set; }
        //public bool WonwsF{ get; set; }
        public bool WaS { get; set; }
        public bool SawFlopNotBlinds{ get; set; }
        public bool SawFlop{ get; set; }
        public bool StealAttempt{ get; set; }
        public bool FoldRiver{ get; set; }
        public bool FoldTurn{ get; set; }
        public bool FoldFlop{ get; set; }
        public bool FoldPreflop{ get; set; }
        public bool minutesPlayed{ get; set; }
    }
}
